
import java.util.concurrent.ConcurrentHashMap;

public class Graph {
	
	private ConcurrentHashMap<Integer, Knoten> knmap;
	
	
	public Graph(){
		knmap = new ConcurrentHashMap<Integer, Knoten>();
	}
	
	public void addKn(Knoten kn){
		knmap.put(kn.getId(), kn);
		
	}
	
	public Knoten getKn(int id){
		return knmap.get(id);
	}

	public ConcurrentHashMap<Integer, Knoten> getKnmap() {
		return knmap;
	}

	public void setKnmap(ConcurrentHashMap<Integer, Knoten> knmap) {
		this.knmap = knmap;
	}
	
	@Override
	public String toString(){
		StringBuffer sb = new StringBuffer();
		for (Knoten k : knmap.values()){
			sb.append(" " + k + " ");
		}
		return sb.toString();
	}

	
}
